﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：QS_SF_HUIGUANTF实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class QS_SF_HUIGUANTF
    {
        private decimal? m_dec_i_huiguanl;

        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_m;

        private decimal? m_dec_i_y;

        private decimal m_dec_id;

        private decimal? m_dec_n_cshgnl;

        private decimal? m_dec_n_huiguandj;

        private decimal? m_dec_n_huiguanjh;

        private decimal? m_dec_n_nhgnl;

        private decimal? m_dec_n_tuifei_w;

        private decimal? m_dec_n_tuifei_y;

        private decimal? m_dec_n_tuifei_z;

        private decimal? m_dec_n_xhgnl;

        private DateTime? m_DT_d_caozuorq;

        private string m_str_s_bumenbh;

        private string m_str_s_bumenmc;

        private string m_str_s_caozuor;

        private string m_str_s_jingbh;

        private string m_str_s_jinglx;

        private string m_str_s_shuibiaobh;

        private string m_str_s_yonghuh;

        private string m_str_s_yonghum;

        /// <summary>
        ///     主键
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     部门编号
        /// </summary>
        public string S_BUMENBH
        {
            get { return m_str_s_bumenbh; }
            set { m_str_s_bumenbh = value; }
        }

        /// <summary>
        ///     部门名称
        /// </summary>
        public string S_BUMENMC
        {
            get { return m_str_s_bumenmc; }
            set { m_str_s_bumenmc = value; }
        }

        /// <summary>
        ///     用户号
        /// </summary>
        public string S_YONGHUH
        {
            get { return m_str_s_yonghuh; }
            set { m_str_s_yonghuh = value; }
        }

        /// <summary>
        ///     用户名
        /// </summary>
        public string S_YONGHUM
        {
            get { return m_str_s_yonghum; }
            set { m_str_s_yonghum = value; }
        }

        /// <summary>
        ///     井编号
        /// </summary>
        public string S_JINGBH
        {
            get { return m_str_s_jingbh; }
            set { m_str_s_jingbh = value; }
        }

        /// <summary>
        ///     井类型
        /// </summary>
        public string S_JINGLX
        {
            get { return m_str_s_jinglx; }
            set { m_str_s_jinglx = value; }
        }

        /// <summary>
        ///     水表编号
        /// </summary>
        public string S_SHUIBIAOBH
        {
            get { return m_str_s_shuibiaobh; }
            set { m_str_s_shuibiaobh = value; }
        }

        /// <summary>
        ///     年回灌能力
        /// </summary>
        public decimal? N_NHGNL
        {
            get { return m_dec_n_nhgnl; }
            set { m_dec_n_nhgnl = value; }
        }

        /// <summary>
        ///     回灌计划
        /// </summary>
        public decimal? N_HUIGUANJH
        {
            get { return m_dec_n_huiguanjh; }
            set { m_dec_n_huiguanjh = value; }
        }

        /// <summary>
        ///     回灌单价
        /// </summary>
        public decimal? N_HUIGUANDJ
        {
            get { return m_dec_n_huiguandj; }
            set { m_dec_n_huiguandj = value; }
        }

        /// <summary>
        ///     回灌量
        /// </summary>
        public decimal? I_HUIGUANL
        {
            get { return m_dec_i_huiguanl; }
            set { m_dec_i_huiguanl = value; }
        }

        /// <summary>
        ///     未退回灌费
        /// </summary>
        public decimal? N_TUIFEI_W
        {
            get { return m_dec_n_tuifei_w; }
            set { m_dec_n_tuifei_w = value; }
        }

        /// <summary>
        ///     已退回灌费
        /// </summary>
        public decimal? N_TUIFEI_Y
        {
            get { return m_dec_n_tuifei_y; }
            set { m_dec_n_tuifei_y = value; }
        }

        /// <summary>
        ///     预退回灌费
        /// </summary>
        public decimal? N_TUIFEI_Z
        {
            get { return m_dec_n_tuifei_z; }
            set { m_dec_n_tuifei_z = value; }
        }

        /// <summary>
        ///     年
        /// </summary>
        public decimal? I_Y
        {
            get { return m_dec_i_y; }
            set { m_dec_i_y = value; }
        }

        /// <summary>
        ///     月
        /// </summary>
        public decimal? I_M
        {
            get { return m_dec_i_m; }
            set { m_dec_i_m = value; }
        }

        /// <summary>
        ///     记录状态
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        ///     现状回灌能力
        /// </summary>
        public decimal? N_XHGNL
        {
            get { return m_dec_n_xhgnl; }
            set { m_dec_n_xhgnl = value; }
        }

        /// <summary>
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        /// </summary>
        public DateTime? D_CAOZUORQ
        {
            get { return m_DT_d_caozuorq; }
            set { m_DT_d_caozuorq = value; }
        }

        /// <summary>
        ///     测试回灌能力
        /// </summary>
        public decimal? N_CSHGNL
        {
            get { return m_dec_n_cshgnl; }
            set { m_dec_n_cshgnl = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class QS_SF_HUIGUANTFProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public QS_SF_HUIGUANTFProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据QS_SF_HUIGUANTF实体添加或者修改QS_SF_HUIGUANTF信息
        /// </summary>
        public bool InsertOrUpdate(QS_SF_HUIGUANTF QS_SF_HUIGUANTF, OracleTransaction Transaction)
        {
            if (QS_SF_HUIGUANTF.ID == 0)
                InsertQS_SF_HUIGUANTF(QS_SF_HUIGUANTF, Transaction);
            else
                UpdateQS_SF_HUIGUANTF(QS_SF_HUIGUANTF, Transaction);
            return QS_SF_HUIGUANTF.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据QS_SF_HUIGUANTF实体添加或修改QS_SF_HUIGUANTF信息
        /// </summary>
        public bool InsertOrUpdate(QS_SF_HUIGUANTF QS_SF_HUIGUANTF)
        {
            return InsertOrUpdate(QS_SF_HUIGUANTF, null);
        }


        /// <summary>
        ///     根据QS_SF_HUIGUANTF主键删除QS_SF_HUIGUANTF信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_SF_HUIGUANTF(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelQS_SF_HUIGUANTF";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据QS_SF_HUIGUANTF主键删除QS_SF_HUIGUANTF信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_SF_HUIGUANTF(decimal ID)
        {
            return DeleteQS_SF_HUIGUANTF(ID, null);
        }

        /// <summary>
        ///     根据条件删除QS_SF_HUIGUANTF信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_SF_HUIGUANTFsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelQS_SF_HUIGUANTFsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除QS_SF_HUIGUANTF信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_SF_HUIGUANTFsDynamic(string WhereClause)
        {
            return DeleteQS_SF_HUIGUANTFsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据QS_SF_HUIGUANTF主键选择QS_SF_HUIGUANTF信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_SF_HUIGUANTF信息</returns>
        public QS_SF_HUIGUANTF SelectQS_SF_HUIGUANTF(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_SF_HUIGUANTF";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var QS_SF_HUIGUANTF = PopulateQS_SF_HUIGUANTF(rd);
                rd.Close();
                return QS_SF_HUIGUANTF;
            }
            return null;
        }

        /// <summary>
        ///     根据QS_SF_HUIGUANTF主键选择QS_SF_HUIGUANTF信息
        /// </summary>
        /// <returns>QS_SF_HUIGUANTF信息</returns>
        public QS_SF_HUIGUANTF SelectQS_SF_HUIGUANTF(decimal ID)
        {
            return SelectQS_SF_HUIGUANTF(ID, null);
        }

        /// <summary>
        ///     选择所有QS_SF_HUIGUANTF信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有QS_SF_HUIGUANTF信息</returns>
        public DataTable SelectQS_SF_HUIGUANTFsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_SF_HUIGUANTFsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有QS_SF_HUIGUANTF信息
        /// </summary>
        /// <returns>所有QS_SF_HUIGUANTF信息</returns>
        public DataTable SelectQS_SF_HUIGUANTFsAll()
        {
            return SelectQS_SF_HUIGUANTFsAll(null);
        }

        /// <summary>
        ///     根据条件选择QS_SF_HUIGUANTF信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_SF_HUIGUANTF信息</returns>
        public DataTable SelectQS_SF_HUIGUANTFsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_SF_HUIGUANTFsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择QS_SF_HUIGUANTF信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>QS_SF_HUIGUANTF信息</returns>
        public DataTable SelectQS_SF_HUIGUANTFsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectQS_SF_HUIGUANTFsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择QS_SF_HUIGUANTF信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_SF_HUIGUANTF信息</returns>
        public DataTable SelectQS_SF_HUIGUANTFsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_SF_HUIGUANTFsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择QS_SF_HUIGUANTF信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>QS_SF_HUIGUANTF信息</returns>
        public DataTable SelectQS_SF_HUIGUANTFsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectQS_SF_HUIGUANTFsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新QS_SF_HUIGUANTF字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_SF_HUIGUANTFsDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdQS_SF_HUIGUANTFDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新QS_SF_HUIGUANTF字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_SF_HUIGUANTFsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateQS_SF_HUIGUANTFsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertQS_SF_HUIGUANTF(QS_SF_HUIGUANTF QS_SF_HUIGUANTF, OracleTransaction Transaction)
        {
            var spName = "CS_InsQS_SF_HUIGUANTF";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_SF_HUIGUANTF.S_BUMENBH;
            storedParams[1].Value = QS_SF_HUIGUANTF.S_BUMENMC;
            storedParams[2].Value = QS_SF_HUIGUANTF.S_YONGHUH;
            storedParams[3].Value = QS_SF_HUIGUANTF.S_YONGHUM;
            storedParams[4].Value = QS_SF_HUIGUANTF.S_JINGBH;
            storedParams[5].Value = QS_SF_HUIGUANTF.S_JINGLX;
            storedParams[6].Value = QS_SF_HUIGUANTF.S_SHUIBIAOBH;
            storedParams[7].Value = QS_SF_HUIGUANTF.N_NHGNL;
            storedParams[8].Value = QS_SF_HUIGUANTF.N_HUIGUANJH;
            storedParams[9].Value = QS_SF_HUIGUANTF.N_HUIGUANDJ;
            storedParams[10].Value = QS_SF_HUIGUANTF.I_HUIGUANL;
            storedParams[11].Value = QS_SF_HUIGUANTF.N_TUIFEI_W;
            storedParams[12].Value = QS_SF_HUIGUANTF.N_TUIFEI_Y;
            storedParams[13].Value = QS_SF_HUIGUANTF.N_TUIFEI_Z;
            storedParams[14].Value = QS_SF_HUIGUANTF.I_Y;
            storedParams[15].Value = QS_SF_HUIGUANTF.I_M;
            storedParams[16].Value = QS_SF_HUIGUANTF.I_JLZT;
            storedParams[17].Value = QS_SF_HUIGUANTF.N_XHGNL;
            storedParams[18].Value = QS_SF_HUIGUANTF.S_CAOZUOR;
            storedParams[19].Value = QS_SF_HUIGUANTF.D_CAOZUORQ;
            storedParams[20].Value = QS_SF_HUIGUANTF.N_CSHGNL;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            QS_SF_HUIGUANTF.ID = Convert.ToInt32(storedParams[21].Value);
            return result;
        }

        private bool UpdateQS_SF_HUIGUANTF(QS_SF_HUIGUANTF QS_SF_HUIGUANTF, OracleTransaction Transaction)
        {
            var spName = "CS_UpdQS_SF_HUIGUANTF";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_SF_HUIGUANTF.S_BUMENBH;
            storedParams[1].Value = QS_SF_HUIGUANTF.S_BUMENMC;
            storedParams[2].Value = QS_SF_HUIGUANTF.S_YONGHUH;
            storedParams[3].Value = QS_SF_HUIGUANTF.S_YONGHUM;
            storedParams[4].Value = QS_SF_HUIGUANTF.S_JINGBH;
            storedParams[5].Value = QS_SF_HUIGUANTF.S_JINGLX;
            storedParams[6].Value = QS_SF_HUIGUANTF.S_SHUIBIAOBH;
            storedParams[7].Value = QS_SF_HUIGUANTF.N_NHGNL;
            storedParams[8].Value = QS_SF_HUIGUANTF.N_HUIGUANJH;
            storedParams[9].Value = QS_SF_HUIGUANTF.N_HUIGUANDJ;
            storedParams[10].Value = QS_SF_HUIGUANTF.I_HUIGUANL;
            storedParams[11].Value = QS_SF_HUIGUANTF.N_TUIFEI_W;
            storedParams[12].Value = QS_SF_HUIGUANTF.N_TUIFEI_Y;
            storedParams[13].Value = QS_SF_HUIGUANTF.N_TUIFEI_Z;
            storedParams[14].Value = QS_SF_HUIGUANTF.I_Y;
            storedParams[15].Value = QS_SF_HUIGUANTF.I_M;
            storedParams[16].Value = QS_SF_HUIGUANTF.I_JLZT;
            storedParams[17].Value = QS_SF_HUIGUANTF.N_XHGNL;
            storedParams[18].Value = QS_SF_HUIGUANTF.S_CAOZUOR;
            storedParams[19].Value = QS_SF_HUIGUANTF.D_CAOZUORQ;
            storedParams[20].Value = QS_SF_HUIGUANTF.N_CSHGNL;
            storedParams[21].Value = QS_SF_HUIGUANTF.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private QS_SF_HUIGUANTF PopulateQS_SF_HUIGUANTF(IDataReader dr)
        {
            var QS_SF_HUIGUANTF = new QS_SF_HUIGUANTF();
            QS_SF_HUIGUANTF.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            QS_SF_HUIGUANTF.S_BUMENBH = dr["S_BUMENBH"] == DBNull.Value ? null : (string) dr["S_BUMENBH"];
            QS_SF_HUIGUANTF.S_BUMENMC = dr["S_BUMENMC"] == DBNull.Value ? null : (string) dr["S_BUMENMC"];
            QS_SF_HUIGUANTF.S_YONGHUH = dr["S_YONGHUH"] == DBNull.Value ? null : (string) dr["S_YONGHUH"];
            QS_SF_HUIGUANTF.S_YONGHUM = dr["S_YONGHUM"] == DBNull.Value ? null : (string) dr["S_YONGHUM"];
            QS_SF_HUIGUANTF.S_JINGBH = dr["S_JINGBH"] == DBNull.Value ? null : (string) dr["S_JINGBH"];
            QS_SF_HUIGUANTF.S_JINGLX = dr["S_JINGLX"] == DBNull.Value ? null : (string) dr["S_JINGLX"];
            QS_SF_HUIGUANTF.S_SHUIBIAOBH = dr["S_SHUIBIAOBH"] == DBNull.Value ? null : (string) dr["S_SHUIBIAOBH"];
            QS_SF_HUIGUANTF.N_NHGNL = dr["N_NHGNL"] == DBNull.Value ? null : (decimal?) dr["N_NHGNL"];
            QS_SF_HUIGUANTF.N_HUIGUANJH = dr["N_HUIGUANJH"] == DBNull.Value ? null : (decimal?) dr["N_HUIGUANJH"];
            QS_SF_HUIGUANTF.N_HUIGUANDJ = dr["N_HUIGUANDJ"] == DBNull.Value ? null : (decimal?) dr["N_HUIGUANDJ"];
            QS_SF_HUIGUANTF.I_HUIGUANL = dr["I_HUIGUANL"] == DBNull.Value ? null : (decimal?) dr["I_HUIGUANL"];
            QS_SF_HUIGUANTF.N_TUIFEI_W = dr["N_TUIFEI_W"] == DBNull.Value ? null : (decimal?) dr["N_TUIFEI_W"];
            QS_SF_HUIGUANTF.N_TUIFEI_Y = dr["N_TUIFEI_Y"] == DBNull.Value ? null : (decimal?) dr["N_TUIFEI_Y"];
            QS_SF_HUIGUANTF.N_TUIFEI_Z = dr["N_TUIFEI_Z"] == DBNull.Value ? null : (decimal?) dr["N_TUIFEI_Z"];
            QS_SF_HUIGUANTF.I_Y = dr["I_Y"] == DBNull.Value ? null : (decimal?) dr["I_Y"];
            QS_SF_HUIGUANTF.I_M = dr["I_M"] == DBNull.Value ? null : (decimal?) dr["I_M"];
            QS_SF_HUIGUANTF.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            QS_SF_HUIGUANTF.N_XHGNL = dr["N_XHGNL"] == DBNull.Value ? null : (decimal?) dr["N_XHGNL"];
            QS_SF_HUIGUANTF.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            QS_SF_HUIGUANTF.D_CAOZUORQ = dr["D_CAOZUORQ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUORQ"];
            QS_SF_HUIGUANTF.N_CSHGNL = dr["N_CSHGNL"] == DBNull.Value ? null : (decimal?) dr["N_CSHGNL"];
            return QS_SF_HUIGUANTF;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion